package com.java.controller.admin;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.java.pojo.entity.UserInfo;
import com.java.pojo.vo.UserInfoQueryVo;
import com.java.result.Result;
import com.java.service.UserInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.catalina.User;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Api("用户管理")
@RestController
@RequestMapping("admin/core/userInfo")
public class AdminUserInfoController {


    @Resource
    private UserInfoService userInfoService;

    //分页条件查询
    @ApiOperation("会员列表分页")
    @GetMapping("/getVipList/{pageNum}/{pageSize}")
    public Result queryUserInfo(@PathVariable Integer pageNum,@PathVariable Integer pageSize, UserInfoQueryVo userInfoQueryVo){
        //
        IPage<UserInfo> pageList = userInfoService.selectByPageList(pageNum,pageSize,userInfoQueryVo);
        return Result.ok(pageList);
    }
    @ApiOperation("锁定用户")
    @GetMapping("/lock/{id}")
    public Result lock(@PathVariable Integer id){
        userInfoService.lock(id);
        return Result.ok();
    }
}
